package cn.com.cym.gamezao.entity.grk;

import cn.com.cym.gamezao.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;


@Getter
@Setter
@NoArgsConstructor
@Entity
@Accessors(chain = true)
@Table(name ="sample_sample_record")
@ApiModel(description = "样本使用记录管理")
public class SampleRecord  extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -5486461070070782477L;

    /**
     * 样本编号
     */
    @ManyToOne
    @JoinColumn(name = "sample_id")
    @JsonProperty(access = JsonProperty.Access.READ_WRITE)
    private Sample sample;

    /**
     * 取用时间
     */
    //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name = "time",value = "取用时间",dataType = "LocalDateTime")
    private LocalDateTime time;


    /**
     * 取用人
     */
    @Column(length = 36)
    private String user;

    /**
     * 取用量
     */
    private Long dosage;

    /**
     * 备注
     */
    @Column(length = 600)
    private String memo;
}
